<?php
$section = "business-solution";
$titre = _LB_BUSINESS_SOLUTION;
$link = $section;
Session::setBackLink($link);
//create cfer
$rootPath = array(
	_LB_HOME => APPLICATION_URL_FO,
    _LB_BUSINESS_SOLUTION => APPLICATION_URL_FO."/business-solutions/");

$bsLeft = Business_Solution::getSubItem(0);
$id = Request::getNumber("id");

$bs = new Business_Solution();
if($id > 0 && $bs->get($id)){
    $titre .= TITLE_PAGE_SEPARATE. $bs->TITLE;
    $smarty->assign('bs', $bs);
    $subBS = Business_Solution::getSubItem($id);
    $smarty->assign('subBS', $subBS);
    
    $pathName = array();
    Business_Solution::getBusinessSolutionPathName($id, $pathName);
    $utils = new Utils();
    for($i = count($pathName);$i>=0;$i--){
        if(isset($pathName[$i]) && is_array($pathName[$i])){
            $item = $pathName[$i];
            $rootPath[$item['TITLE']] = APPLICATION_URL_FO."/business-solutions/".$item['ID']."/". $utils->RemoveSign($item['TITLE']);    
        }
    }
}

$path = array($id);
Business_Solution::getBusinessSolutionPath($id, $path);
$arrBS = array();
Business_Solution::getAllSubItem(0, $arrBS, $path);

$rootBS = Business_Solution::getSubItem(0);


$cfer = new Cfer($rootPath);
Session::setBackCfer($link, $cfer->getCferArray());
$smarty->assign('cfer', $cfer);
$smarty->assign('bsLeft', $arrBS);
$smarty->assign('rootBS', $rootBS);
$smarty->assign('id', $id);
$smarty->assign('titre', $titre);



$smarty->display("business-solution.html");